"""
文件写入
"""
file_name = "a.txt"
file = open(file_name,"a+",encoding="utf-8")
list = ["赵客缦胡缨，","吴钩霜雪明。","银鞍照白马，","SATA如流星！"]
for i in list:
    # 写入方法一: write
    file.write(i)
    file.write("\n")

    # 写入方法二: print
    # print("",file=f)
    # print("",file=f)


print("file.name",file.name)
print("file.mode",file.mode)
print("file.encoding",file.encoding)
print("file.closed",file.closed)

file.close()
# print(file)
print("文件写入成功!",file_name)